🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / database / src / androidTest / kotlin / org / meshtastic / core / database / MeshtasticDatabaseTest.kt
Displaying Raw • Download
core/database/src/androidTest/kotlin/org/meshtastic/core/database/MeshtasticDatabaseTest.kt 1c3784235e7e20ed88e054097d2e7addbff92dc3 (1c378423) Text, 1.89 KB
T8b949e/*
* Copyright (c) 2025 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.database
Tff7b72import T7ee787androidx.room.Room
Tff7b72import T7ee787androidx.room.testing.MigrationTestHelper
Tff7b72import T7ee787androidx.test.ext.junit.runners.AndroidJUnit4
Tff7b72import T7ee787androidx.test.platform.app.InstrumentationRegistry
Tff7b72import T7ee787org.junit.Rule
Tff7b72import T7ee787org.junit.Test
Tff7b72import T7ee787org.junit.runner.RunWith
Tff7b72import T7ee787java.io.IOException
Tf0883e@RunWithTb4b4b4(Te6edf3AndroidJUnit4Tff7b72::Te6edf3classTb4b4b4)
Tff7b72class T56d364MeshtasticDatabaseTest Tb4b4b4{
Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72private Tff7b72const Tff7b72val Te6edf3TEST_DB Tff7b72= Ta5d6ff"Ta5d6ffmigration-testTa5d6ff"
Tb4b4b4}
Tf0883e@getTb4b4b4:Te6edf3Rule
Tff7b72val Te6edf3helperTb4b4b4: Te6edf3MigrationTestHelper Tff7b72=
Te6edf3MigrationTestHelperTb4b4b4(Te6edf3InstrumentationRegistryTb4b4b4.Te6edf3getInstrumentationTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3MeshtasticDatabaseTff7b72::Te6edf3classTb4b4b4.Te6edf3javaTb4b4b4)
Tf0883e@Test
Tf0883e@ThrowsTb4b4b4(Te6edf3IOExceptionTff7b72::Te6edf3classTb4b4b4)
Tff7b72fun Td2a8ffmigrateAllTb4b4b4(Tb4b4b4) Tb4b4b4{
T8b949e// Create earliest version of the database.
Te6edf3helperTb4b4b4.Te6edf3createDatabaseTb4b4b4(Te6edf3TEST_DBTb4b4b4, T79c0ff3Tb4b4b4)Tb4b4b4.Te6edf3apply Tb4b4b4{ Te6edf3closeTb4b4b4(Tb4b4b4) Tb4b4b4}
T8b949e// Open latest version of the database. Room validates the schema
T8b949e// once all migrations execute.
Te6edf3RoomTb4b4b4.Te6edf3databaseBuilderTb4b4b4(
Te6edf3InstrumentationRegistryTb4b4b4.Te6edf3getInstrumentationTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3targetContextTb4b4b4,
Te6edf3MeshtasticDatabaseTff7b72::Te6edf3classTb4b4b4.Te6edf3javaTb4b4b4,
Te6edf3TEST_DBTb4b4b4,
Tb4b4b4)
Tb4b4b4.Te6edf3buildTb4b4b4(Tb4b4b4)
Tb4b4b4.Te6edf3apply Tb4b4b4{ Te6edf3openHelperTb4b4b4.Te6edf3writableDatabaseTb4b4b4.Te6edf3closeTb4b4b4(Tb4b4b4) Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.08s